/**
 * Created with IntelliJ IDEA.
 * User: Bluishoul
 * Date: 13-11-4
 * Time: 上午10:48
 */

var tip = function(key,callback){
	$.getJSON('http://192.168.1.88:88/tips?callback=?',{key:key},callback)
};

var projects = [];
$('strong').map(function(){
	var self = $(this);
	var key = self.text();
	self.attr('id',key.toLowerCase().replace('.',''));
	if(key && projects.indexOf()==-1)
		projects.push(key.toLowerCase());
});

tip(projects.join(','),function(msg){
	$.each(projects,function(k,v){
		if(v){
			var a = $('<a target="_blank"></a>');
			a.attr('href',msg[v].url);
			$('#'+v.replace('.','')).wrap(a);
		}
	});
});
